#ifndef _BUOLA_MEDIA_SUPPORT_PULSE_CPULSECONTEXT_H_
#define _BUOLA_MEDIA_SUPPORT_PULSE_CPULSECONTEXT_H_

#include "cpulseloop.h"
#include <pulse/context.h>

namespace buola { namespace media { namespace pulse {

class CPulseLoop;

class CPulseContext
{
public:
    CPulseContext(CPulseLoop &lLoop,const std::string &pName);
    ~CPulseContext();

    void Connect();
    void Connect(const std::string &pServer);

    bool WaitForConnection();

    CPulseLoop &GetLoop()   {   return mLoop;   }

private:
    pa_context *mCtx;
    CPulseLoop &mLoop;

    friend class CPulseStream;
    friend class CPulseMixer;
};

/*namespace pulse*/ } /*namespace media*/ } /*namespace buola*/ }

#endif /* __BLACKBOX_CPULSELOOP_H__ */
